﻿@model Bieb.Web.Models.Publishers.ViewPublisherModel

@{
    ViewBag.Title = Model.Name;
}

@if (User.Identity.IsAuthenticated)
{
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            @using (Html.BeginForm("Delete", "Publishers", FormMethod.Post, new { @class = "navbar-form navbar-left" }))
            {
                @Html.AntiForgeryToken()
                @Html.HiddenFor(model => model.Id)
                
                <a href="@Url.Action("Create", "Publishers")" class="btn btn-default">
                    <i class="glyphicon glyphicon-star"></i>
                    <span class="hidden-xs">@BiebResources.SharedStrings.CreateNew</span>
                </a>
                
                <a href="@Url.Action("Edit", "Publishers", new { Model.Id })" class="btn btn-default">
                    <i class="glyphicon glyphicon-pencil"></i>
                    <span class="hidden-xs">@BiebResources.SharedStrings.Edit</span>
                </a>
                
                <button class="btn btn-default" type="submit" onclick="return confirm('@BiebResources.SharedStrings.SimpleConfirmQuestion')">
                    <i class="glyphicon glyphicon-trash"></i>
                    <span class="hidden-xs">@BiebResources.SharedStrings.Delete</span>
                </button>
            }
        </div>
    </nav>
}

<h1>@Model.Name</h1>

@if (Model.MyBooks.Any())
{
    <h4>@BiebResources.PublisherStrings.BooksFromThisPublisher</h4>
    Html.RenderPartial("~/Views/Books/ItemList.cshtml", Model.MyBooks);
}

@if (Model.Stories.Any())
{
    <h4>@BiebResources.PublisherStrings.StoriesFromThisPublisher</h4>
    Html.RenderPartial("~/Views/Stories/ItemList.cshtml", Model.Stories);
}

@if (Model.ReferenceBooks.Any())
{
    <h4>@BiebResources.PublisherStrings.ReferenceBooksFromThisPublisher</h4>
    Html.RenderPartial("~/Views/Books/ItemList.cshtml", Model.ReferenceBooks);
}